#!/bin/bash

# postinst script for system-kernel
#
# see: dh_installdeb(1)

#set -e

# summary of how this script can be called:
#        * <postinst> \`configure' <most-recently-configured-version>
#        * <old-postinst> \`abort-upgrade' <new version>
#        * <conflictor's-postinst> \`abort-remove' \`in-favour' <package>
#          <new-version>
#        * <postinst> \`abort-remove'
#        * <deconfigured's-postinst> \`abort-deconfigure' \`in-favour'
#          <failed-install-package> <version> \`removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

PATH=/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export PATH

if [ "${BASEDIR:=/}" = "/" ]; then
    BASEDIR=""
else
    BASEDIR_OPT="-b $BASEDIR"
fi

case "$1" in
    configure)
        chown root:bin $BASEDIR/usr/share/man/man4p
	chown root:bin $BASEDIR/usr/share/man/man9
	chown root:bin $BASEDIR/usr/share/man/man9p
	chown root:bin $BASEDIR/lib
	chown root:bin $BASEDIR/lib/svc
	chown root:bin $BASEDIR/lib/svc/method
	chown root:sys $BASEDIR/boot
	chown root:sys $BASEDIR/boot/acpi
	chown root:sys $BASEDIR/boot/acpi/tables
	chown root:sys $BASEDIR/boot/solaris
	chown root:sys $BASEDIR/boot/solaris/bin
	chown root:sys $BASEDIR/etc/sock2path.d
	chown root:sys $BASEDIR/kernel
	chown root:sys $BASEDIR/kernel/amd64
	chown root:sys $BASEDIR/kernel/cc
	chown root:sys $BASEDIR/kernel/cc/amd64
	chown root:sys $BASEDIR/kernel/crypto
	chown root:sys $BASEDIR/kernel/crypto/amd64
	chown root:sys $BASEDIR/kernel/dacf
	chown root:sys $BASEDIR/kernel/dacf/amd64
	chown root:sys $BASEDIR/kernel/drv
	chown root:sys $BASEDIR/kernel/drv/amd64
	chown root:sys $BASEDIR/kernel/exec
	chown root:sys $BASEDIR/kernel/exec/amd64
	chown root:sys $BASEDIR/kernel/firmware
	chown root:sys $BASEDIR/kernel/fs
	chown root:sys $BASEDIR/kernel/fs/amd64
	chown root:sys $BASEDIR/kernel/ipp
	chown root:sys $BASEDIR/kernel/ipp/amd64
	chown root:sys $BASEDIR/kernel/kiconv
	chown root:sys $BASEDIR/kernel/kiconv/amd64
	chown root:sys $BASEDIR/kernel/mac
	chown root:sys $BASEDIR/kernel/mac/amd64
	chown root:sys $BASEDIR/kernel/misc
	chown root:sys $BASEDIR/kernel/misc/amd64
	chown root:sys $BASEDIR/kernel/misc/scsi_vhci
	chown root:sys $BASEDIR/kernel/misc/scsi_vhci/amd64
	chown root:sys $BASEDIR/kernel/sched
	chown root:sys $BASEDIR/kernel/sched/amd64
	chown root:sys $BASEDIR/kernel/socketmod
	chown root:sys $BASEDIR/kernel/socketmod/amd64
	chown root:sys $BASEDIR/kernel/strmod
	chown root:sys $BASEDIR/kernel/strmod/amd64
	chown root:sys $BASEDIR/kernel/sys
	chown root:sys $BASEDIR/kernel/sys/amd64
	chown root:sys $BASEDIR/lib/svc/manifest
	chown root:sys $BASEDIR/lib/svc/manifest/system
	chown root:sys $BASEDIR/usr/kernel/exec
	chown root:sys $BASEDIR/usr/kernel/exec/amd64
	chown root:sys $BASEDIR/usr/kernel/fs
	chown root:sys $BASEDIR/usr/kernel/fs/amd64
	chown root:sys $BASEDIR/usr/kernel/sys
	chown root:sys $BASEDIR/usr/kernel/sys/amd64
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/boot/solaris/bin/create_diskmap ] && rm -f $BASEDIR/boot/solaris/bin/create_diskmap
	else
	    chmod 0555 "$BASEDIR/boot/solaris/bin/create_diskmap"
	    chown root:sys "$BASEDIR/boot/solaris/bin/create_diskmap"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/boot/solaris/bin/extract_boot_filelist ] && rm -f $BASEDIR/boot/solaris/bin/extract_boot_filelist
	else
	    chmod 0555 "$BASEDIR/boot/solaris/bin/extract_boot_filelist"
	    chown root:sys "$BASEDIR/boot/solaris/bin/extract_boot_filelist"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/boot/solaris/bin/symdef ] && rm -f $BASEDIR/boot/solaris/bin/symdef
	else
	    chmod 0555 "$BASEDIR/boot/solaris/bin/symdef"
	    chown root:sys "$BASEDIR/boot/solaris/bin/symdef"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/boot/solaris/bin/update_grub ] && rm -f $BASEDIR/boot/solaris/bin/update_grub
	else
	    chmod 0555 "$BASEDIR/boot/solaris/bin/update_grub"
	    chown root:sys "$BASEDIR/boot/solaris/bin/update_grub"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/etc/crypto/kcf.conf ] && rm -f $BASEDIR/etc/crypto/kcf.conf
	else
	    [ -f $BASEDIR/etc/crypto/kcf.conf ] || cp -ax $BASEDIR/usr/share/doc/system-kernel/examples/kcf.conf $BASEDIR/etc/crypto/kcf.conf
	    chmod 0644 "$BASEDIR/etc/crypto/kcf.conf"
	    chown root:sys "$BASEDIR/etc/crypto/kcf.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/etc/name_to_sysnum ] && rm -f $BASEDIR/etc/name_to_sysnum
	else
	    [ -f $BASEDIR/etc/name_to_sysnum ] || cp -ax $BASEDIR/usr/share/doc/system-kernel/examples/name_to_sysnum $BASEDIR/etc/name_to_sysnum
	    chmod 0644 "$BASEDIR/etc/name_to_sysnum"
	    chown root:sys "$BASEDIR/etc/name_to_sysnum"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/log.conf ] && rm -f $BASEDIR/kernel/drv/log.conf
	else
	    [ -f $BASEDIR/kernel/drv/log.conf ] || cp -ax $BASEDIR/usr/share/doc/system-kernel/examples/log.conf $BASEDIR/kernel/drv/log.conf
	    chmod 0644 "$BASEDIR/kernel/drv/log.conf"
	    chown root:sys "$BASEDIR/kernel/drv/log.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/mpt.conf ] && rm -f $BASEDIR/kernel/drv/mpt.conf
	else
	    [ -f $BASEDIR/kernel/drv/mpt.conf ] || cp -ax $BASEDIR/usr/share/doc/system-kernel/examples/mpt.conf $BASEDIR/kernel/drv/mpt.conf
	    chmod 0644 "$BASEDIR/kernel/drv/mpt.conf"
	    chown root:sys "$BASEDIR/kernel/drv/mpt.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/sgen.conf ] && rm -f $BASEDIR/kernel/drv/sgen.conf
	else
	    [ -f $BASEDIR/kernel/drv/sgen.conf ] || cp -ax $BASEDIR/usr/share/doc/system-kernel/examples/sgen.conf $BASEDIR/kernel/drv/sgen.conf
	    chmod 0644 "$BASEDIR/kernel/drv/sgen.conf"
	    chown root:sys "$BASEDIR/kernel/drv/sgen.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/st.conf ] && rm -f $BASEDIR/kernel/drv/st.conf
	else
	    [ -f $BASEDIR/kernel/drv/st.conf ] || cp -ax $BASEDIR/usr/share/doc/system-kernel/examples/st.conf $BASEDIR/kernel/drv/st.conf
	    chmod 0644 "$BASEDIR/kernel/drv/st.conf"
	    chown root:sys "$BASEDIR/kernel/drv/st.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/etc/mach ] && rm -f $BASEDIR/etc/mach
	else
	    [ -f $BASEDIR/etc/mach ] || cp -ax $BASEDIR/usr/share/doc/system-kernel/examples/mach $BASEDIR/etc/mach
	    chmod 0644 "$BASEDIR/etc/mach"
	    chown root:sys "$BASEDIR/etc/mach"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/boot/solaris/filelist.ramdisk ] && rm -f $BASEDIR/boot/solaris/filelist.ramdisk
	else
	    chmod 0644 "$BASEDIR/boot/solaris/filelist.ramdisk"
	    chown root:sys "$BASEDIR/boot/solaris/filelist.ramdisk"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/boot/solaris/filelist.safe ] && rm -f $BASEDIR/boot/solaris/filelist.safe
	else
	    chmod 0644 "$BASEDIR/boot/solaris/filelist.safe"
	    chown root:sys "$BASEDIR/boot/solaris/filelist.safe"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/etc/sock2path.d/system%2Fkernel ] && rm -f $BASEDIR/etc/sock2path.d/system%2Fkernel
	else
	    chmod 0644 "$BASEDIR/etc/sock2path.d/system%2Fkernel"
	    chown root:sys "$BASEDIR/etc/sock2path.d/system%2Fkernel"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/etc/system ] && rm -f $BASEDIR/etc/system
	else
	    [ -f $BASEDIR/etc/system ] || cp -ax $BASEDIR/usr/share/doc/system-kernel/examples/system $BASEDIR/etc/system
	    chmod 0644 "$BASEDIR/etc/system"
	    chown root:sys "$BASEDIR/etc/system"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/acpi_drv.conf ] && rm -f $BASEDIR/kernel/drv/acpi_drv.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/acpi_drv.conf"
	    chown root:sys "$BASEDIR/kernel/drv/acpi_drv.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/aggr.conf ] && rm -f $BASEDIR/kernel/drv/aggr.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/aggr.conf"
	    chown root:sys "$BASEDIR/kernel/drv/aggr.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/arp.conf ] && rm -f $BASEDIR/kernel/drv/arp.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/arp.conf"
	    chown root:sys "$BASEDIR/kernel/drv/arp.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/bl.conf ] && rm -f $BASEDIR/kernel/drv/bl.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/bl.conf"
	    chown root:sys "$BASEDIR/kernel/drv/bl.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/bridge.conf ] && rm -f $BASEDIR/kernel/drv/bridge.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/bridge.conf"
	    chown root:sys "$BASEDIR/kernel/drv/bridge.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/cn.conf ] && rm -f $BASEDIR/kernel/drv/cn.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/cn.conf"
	    chown root:sys "$BASEDIR/kernel/drv/cn.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/conskbd.conf ] && rm -f $BASEDIR/kernel/drv/conskbd.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/conskbd.conf"
	    chown root:sys "$BASEDIR/kernel/drv/conskbd.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/consms.conf ] && rm -f $BASEDIR/kernel/drv/consms.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/consms.conf"
	    chown root:sys "$BASEDIR/kernel/drv/consms.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/cpuid.conf ] && rm -f $BASEDIR/kernel/drv/cpuid.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/cpuid.conf"
	    chown root:sys "$BASEDIR/kernel/drv/cpuid.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/crypto.conf ] && rm -f $BASEDIR/kernel/drv/crypto.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/crypto.conf"
	    chown root:sys "$BASEDIR/kernel/drv/crypto.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/cryptoadm.conf ] && rm -f $BASEDIR/kernel/drv/cryptoadm.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/cryptoadm.conf"
	    chown root:sys "$BASEDIR/kernel/drv/cryptoadm.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/devinfo.conf ] && rm -f $BASEDIR/kernel/drv/devinfo.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/devinfo.conf"
	    chown root:sys "$BASEDIR/kernel/drv/devinfo.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/dld.conf ] && rm -f $BASEDIR/kernel/drv/dld.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/dld.conf"
	    chown root:sys "$BASEDIR/kernel/drv/dld.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/dlpistub.conf ] && rm -f $BASEDIR/kernel/drv/dlpistub.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/dlpistub.conf"
	    chown root:sys "$BASEDIR/kernel/drv/dlpistub.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/icmp.conf ] && rm -f $BASEDIR/kernel/drv/icmp.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/icmp.conf"
	    chown root:sys "$BASEDIR/kernel/drv/icmp.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/icmp6.conf ] && rm -f $BASEDIR/kernel/drv/icmp6.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/icmp6.conf"
	    chown root:sys "$BASEDIR/kernel/drv/icmp6.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/intel_nb5000.conf ] && rm -f $BASEDIR/kernel/drv/intel_nb5000.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/intel_nb5000.conf"
	    chown root:sys "$BASEDIR/kernel/drv/intel_nb5000.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/intel_nhm.conf ] && rm -f $BASEDIR/kernel/drv/intel_nhm.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/intel_nhm.conf"
	    chown root:sys "$BASEDIR/kernel/drv/intel_nhm.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/intel_nhmex.conf ] && rm -f $BASEDIR/kernel/drv/intel_nhmex.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/intel_nhmex.conf"
	    chown root:sys "$BASEDIR/kernel/drv/intel_nhmex.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/ip.conf ] && rm -f $BASEDIR/kernel/drv/ip.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/ip.conf"
	    chown root:sys "$BASEDIR/kernel/drv/ip.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/ip6.conf ] && rm -f $BASEDIR/kernel/drv/ip6.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/ip6.conf"
	    chown root:sys "$BASEDIR/kernel/drv/ip6.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/ipnet.conf ] && rm -f $BASEDIR/kernel/drv/ipnet.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/ipnet.conf"
	    chown root:sys "$BASEDIR/kernel/drv/ipnet.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/ippctl.conf ] && rm -f $BASEDIR/kernel/drv/ippctl.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/ippctl.conf"
	    chown root:sys "$BASEDIR/kernel/drv/ippctl.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/ipsecah.conf ] && rm -f $BASEDIR/kernel/drv/ipsecah.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/ipsecah.conf"
	    chown root:sys "$BASEDIR/kernel/drv/ipsecah.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/ipsecesp.conf ] && rm -f $BASEDIR/kernel/drv/ipsecesp.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/ipsecesp.conf"
	    chown root:sys "$BASEDIR/kernel/drv/ipsecesp.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/iptun.conf ] && rm -f $BASEDIR/kernel/drv/iptun.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/iptun.conf"
	    chown root:sys "$BASEDIR/kernel/drv/iptun.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/iwscn.conf ] && rm -f $BASEDIR/kernel/drv/iwscn.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/iwscn.conf"
	    chown root:sys "$BASEDIR/kernel/drv/iwscn.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/keysock.conf ] && rm -f $BASEDIR/kernel/drv/keysock.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/keysock.conf"
	    chown root:sys "$BASEDIR/kernel/drv/keysock.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/kmdb.conf ] && rm -f $BASEDIR/kernel/drv/kmdb.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/kmdb.conf"
	    chown root:sys "$BASEDIR/kernel/drv/kmdb.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/ksensor.conf ] && rm -f $BASEDIR/kernel/drv/ksensor.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/ksensor.conf"
	    chown root:sys "$BASEDIR/kernel/drv/ksensor.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/llc1.conf ] && rm -f $BASEDIR/kernel/drv/llc1.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/llc1.conf"
	    chown root:sys "$BASEDIR/kernel/drv/llc1.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/lofi.conf ] && rm -f $BASEDIR/kernel/drv/lofi.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/lofi.conf"
	    chown root:sys "$BASEDIR/kernel/drv/lofi.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/mc-amd.conf ] && rm -f $BASEDIR/kernel/drv/mc-amd.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/mc-amd.conf"
	    chown root:sys "$BASEDIR/kernel/drv/mc-amd.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/mm.conf ] && rm -f $BASEDIR/kernel/drv/mm.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/mm.conf"
	    chown root:sys "$BASEDIR/kernel/drv/mm.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/openeepr.conf ] && rm -f $BASEDIR/kernel/drv/openeepr.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/openeepr.conf"
	    chown root:sys "$BASEDIR/kernel/drv/openeepr.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/options.conf ] && rm -f $BASEDIR/kernel/drv/options.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/options.conf"
	    chown root:sys "$BASEDIR/kernel/drv/options.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/pcieb.conf ] && rm -f $BASEDIR/kernel/drv/pcieb.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/pcieb.conf"
	    chown root:sys "$BASEDIR/kernel/drv/pcieb.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/physmem.conf ] && rm -f $BASEDIR/kernel/drv/physmem.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/physmem.conf"
	    chown root:sys "$BASEDIR/kernel/drv/physmem.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/poll.conf ] && rm -f $BASEDIR/kernel/drv/poll.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/poll.conf"
	    chown root:sys "$BASEDIR/kernel/drv/poll.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/power.conf ] && rm -f $BASEDIR/kernel/drv/power.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/power.conf"
	    chown root:sys "$BASEDIR/kernel/drv/power.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/pseudo.conf ] && rm -f $BASEDIR/kernel/drv/pseudo.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/pseudo.conf"
	    chown root:sys "$BASEDIR/kernel/drv/pseudo.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/ptc.conf ] && rm -f $BASEDIR/kernel/drv/ptc.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/ptc.conf"
	    chown root:sys "$BASEDIR/kernel/drv/ptc.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/ptsl.conf ] && rm -f $BASEDIR/kernel/drv/ptsl.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/ptsl.conf"
	    chown root:sys "$BASEDIR/kernel/drv/ptsl.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/ramdisk.conf ] && rm -f $BASEDIR/kernel/drv/ramdisk.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/ramdisk.conf"
	    chown root:sys "$BASEDIR/kernel/drv/ramdisk.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/random.conf ] && rm -f $BASEDIR/kernel/drv/random.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/random.conf"
	    chown root:sys "$BASEDIR/kernel/drv/random.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/rts.conf ] && rm -f $BASEDIR/kernel/drv/rts.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/rts.conf"
	    chown root:sys "$BASEDIR/kernel/drv/rts.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/sad.conf ] && rm -f $BASEDIR/kernel/drv/sad.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/sad.conf"
	    chown root:sys "$BASEDIR/kernel/drv/sad.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/scsi_vhci.conf ] && rm -f $BASEDIR/kernel/drv/scsi_vhci.conf
	else
	    [ -f $BASEDIR/kernel/drv/scsi_vhci.conf ] || cp -ax $BASEDIR/usr/share/doc/system-kernel/examples/scsi_vhci.conf $BASEDIR/kernel/drv/scsi_vhci.conf
	    chmod 0644 "$BASEDIR/kernel/drv/scsi_vhci.conf"
	    chown root:sys "$BASEDIR/kernel/drv/scsi_vhci.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/sd.conf ] && rm -f $BASEDIR/kernel/drv/sd.conf
	else
	    [ -f $BASEDIR/kernel/drv/sd.conf ] || cp -ax $BASEDIR/usr/share/doc/system-kernel/examples/sd.conf $BASEDIR/kernel/drv/sd.conf
	    chmod 0644 "$BASEDIR/kernel/drv/sd.conf"
	    chown root:sys "$BASEDIR/kernel/drv/sd.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/simnet.conf ] && rm -f $BASEDIR/kernel/drv/simnet.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/simnet.conf"
	    chown root:sys "$BASEDIR/kernel/drv/simnet.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/smbios.conf ] && rm -f $BASEDIR/kernel/drv/smbios.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/smbios.conf"
	    chown root:sys "$BASEDIR/kernel/drv/smbios.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/softmac.conf ] && rm -f $BASEDIR/kernel/drv/softmac.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/softmac.conf"
	    chown root:sys "$BASEDIR/kernel/drv/softmac.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/spdsock.conf ] && rm -f $BASEDIR/kernel/drv/spdsock.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/spdsock.conf"
	    chown root:sys "$BASEDIR/kernel/drv/spdsock.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/sy.conf ] && rm -f $BASEDIR/kernel/drv/sy.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/sy.conf"
	    chown root:sys "$BASEDIR/kernel/drv/sy.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/sysevent.conf ] && rm -f $BASEDIR/kernel/drv/sysevent.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/sysevent.conf"
	    chown root:sys "$BASEDIR/kernel/drv/sysevent.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/sysmsg.conf ] && rm -f $BASEDIR/kernel/drv/sysmsg.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/sysmsg.conf"
	    chown root:sys "$BASEDIR/kernel/drv/sysmsg.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/tcp.conf ] && rm -f $BASEDIR/kernel/drv/tcp.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/tcp.conf"
	    chown root:sys "$BASEDIR/kernel/drv/tcp.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/tcp6.conf ] && rm -f $BASEDIR/kernel/drv/tcp6.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/tcp6.conf"
	    chown root:sys "$BASEDIR/kernel/drv/tcp6.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/tl.conf ] && rm -f $BASEDIR/kernel/drv/tl.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/tl.conf"
	    chown root:sys "$BASEDIR/kernel/drv/tl.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/tzmon.conf ] && rm -f $BASEDIR/kernel/drv/tzmon.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/tzmon.conf"
	    chown root:sys "$BASEDIR/kernel/drv/tzmon.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/ucode.conf ] && rm -f $BASEDIR/kernel/drv/ucode.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/ucode.conf"
	    chown root:sys "$BASEDIR/kernel/drv/ucode.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/udp.conf ] && rm -f $BASEDIR/kernel/drv/udp.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/udp.conf"
	    chown root:sys "$BASEDIR/kernel/drv/udp.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/udp6.conf ] && rm -f $BASEDIR/kernel/drv/udp6.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/udp6.conf"
	    chown root:sys "$BASEDIR/kernel/drv/udp6.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/ufm.conf ] && rm -f $BASEDIR/kernel/drv/ufm.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/ufm.conf"
	    chown root:sys "$BASEDIR/kernel/drv/ufm.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/vnd.conf ] && rm -f $BASEDIR/kernel/drv/vnd.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/vnd.conf"
	    chown root:sys "$BASEDIR/kernel/drv/vnd.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/vnic.conf ] && rm -f $BASEDIR/kernel/drv/vnic.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/vnic.conf"
	    chown root:sys "$BASEDIR/kernel/drv/vnic.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/wc.conf ] && rm -f $BASEDIR/kernel/drv/wc.conf
	else
	    chmod 0644 "$BASEDIR/kernel/drv/wc.conf"
	    chown root:sys "$BASEDIR/kernel/drv/wc.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/dump.conf ] && rm -f $BASEDIR/usr/kernel/drv/dump.conf
	else
	    chmod 0644 "$BASEDIR/usr/kernel/drv/dump.conf"
	    chown root:sys "$BASEDIR/usr/kernel/drv/dump.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/eventfd.conf ] && rm -f $BASEDIR/usr/kernel/drv/eventfd.conf
	else
	    chmod 0644 "$BASEDIR/usr/kernel/drv/eventfd.conf"
	    chown root:sys "$BASEDIR/usr/kernel/drv/eventfd.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/fssnap.conf ] && rm -f $BASEDIR/usr/kernel/drv/fssnap.conf
	else
	    chmod 0644 "$BASEDIR/usr/kernel/drv/fssnap.conf"
	    chown root:sys "$BASEDIR/usr/kernel/drv/fssnap.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/inotify.conf ] && rm -f $BASEDIR/usr/kernel/drv/inotify.conf
	else
	    chmod 0644 "$BASEDIR/usr/kernel/drv/inotify.conf"
	    chown root:sys "$BASEDIR/usr/kernel/drv/inotify.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/kstat.conf ] && rm -f $BASEDIR/usr/kernel/drv/kstat.conf
	else
	    chmod 0644 "$BASEDIR/usr/kernel/drv/kstat.conf"
	    chown root:sys "$BASEDIR/usr/kernel/drv/kstat.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/ksyms.conf ] && rm -f $BASEDIR/usr/kernel/drv/ksyms.conf
	else
	    chmod 0644 "$BASEDIR/usr/kernel/drv/ksyms.conf"
	    chown root:sys "$BASEDIR/usr/kernel/drv/ksyms.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/logindmux.conf ] && rm -f $BASEDIR/usr/kernel/drv/logindmux.conf
	else
	    chmod 0644 "$BASEDIR/usr/kernel/drv/logindmux.conf"
	    chown root:sys "$BASEDIR/usr/kernel/drv/logindmux.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/ptm.conf ] && rm -f $BASEDIR/usr/kernel/drv/ptm.conf
	else
	    chmod 0644 "$BASEDIR/usr/kernel/drv/ptm.conf"
	    chown root:sys "$BASEDIR/usr/kernel/drv/ptm.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/pts.conf ] && rm -f $BASEDIR/usr/kernel/drv/pts.conf
	else
	    chmod 0644 "$BASEDIR/usr/kernel/drv/pts.conf"
	    chown root:sys "$BASEDIR/usr/kernel/drv/pts.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/signalfd.conf ] && rm -f $BASEDIR/usr/kernel/drv/signalfd.conf
	else
	    chmod 0644 "$BASEDIR/usr/kernel/drv/signalfd.conf"
	    chown root:sys "$BASEDIR/usr/kernel/drv/signalfd.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/timerfd.conf ] && rm -f $BASEDIR/usr/kernel/drv/timerfd.conf
	else
	    chmod 0644 "$BASEDIR/usr/kernel/drv/timerfd.conf"
	    chown root:sys "$BASEDIR/usr/kernel/drv/timerfd.conf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/amd64/genunix ] && rm -f $BASEDIR/kernel/amd64/genunix
	else
	    chmod 0755 "$BASEDIR/kernel/amd64/genunix"
	    chown root:sys "$BASEDIR/kernel/amd64/genunix"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/cc/amd64/cc_cubic ] && rm -f $BASEDIR/kernel/cc/amd64/cc_cubic
	else
	    chmod 0755 "$BASEDIR/kernel/cc/amd64/cc_cubic"
	    chown root:sys "$BASEDIR/kernel/cc/amd64/cc_cubic"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/cc/amd64/cc_newreno ] && rm -f $BASEDIR/kernel/cc/amd64/cc_newreno
	else
	    chmod 0755 "$BASEDIR/kernel/cc/amd64/cc_newreno"
	    chown root:sys "$BASEDIR/kernel/cc/amd64/cc_newreno"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/cc/amd64/cc_sunreno ] && rm -f $BASEDIR/kernel/cc/amd64/cc_sunreno
	else
	    chmod 0755 "$BASEDIR/kernel/cc/amd64/cc_sunreno"
	    chown root:sys "$BASEDIR/kernel/cc/amd64/cc_sunreno"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/crypto/amd64/aes ] && rm -f $BASEDIR/kernel/crypto/amd64/aes
	else
	    chmod 0755 "$BASEDIR/kernel/crypto/amd64/aes"
	    chown root:sys "$BASEDIR/kernel/crypto/amd64/aes"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/crypto/amd64/arcfour ] && rm -f $BASEDIR/kernel/crypto/amd64/arcfour
	else
	    chmod 0755 "$BASEDIR/kernel/crypto/amd64/arcfour"
	    chown root:sys "$BASEDIR/kernel/crypto/amd64/arcfour"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/crypto/amd64/blowfish ] && rm -f $BASEDIR/kernel/crypto/amd64/blowfish
	else
	    chmod 0755 "$BASEDIR/kernel/crypto/amd64/blowfish"
	    chown root:sys "$BASEDIR/kernel/crypto/amd64/blowfish"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/crypto/amd64/des ] && rm -f $BASEDIR/kernel/crypto/amd64/des
	else
	    chmod 0755 "$BASEDIR/kernel/crypto/amd64/des"
	    chown root:sys "$BASEDIR/kernel/crypto/amd64/des"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/crypto/amd64/ecc ] && rm -f $BASEDIR/kernel/crypto/amd64/ecc
	else
	    chmod 0755 "$BASEDIR/kernel/crypto/amd64/ecc"
	    chown root:sys "$BASEDIR/kernel/crypto/amd64/ecc"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/crypto/amd64/edonr ] && rm -f $BASEDIR/kernel/crypto/amd64/edonr
	else
	    chmod 0755 "$BASEDIR/kernel/crypto/amd64/edonr"
	    chown root:sys "$BASEDIR/kernel/crypto/amd64/edonr"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/crypto/amd64/md4 ] && rm -f $BASEDIR/kernel/crypto/amd64/md4
	else
	    chmod 0755 "$BASEDIR/kernel/crypto/amd64/md4"
	    chown root:sys "$BASEDIR/kernel/crypto/amd64/md4"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/crypto/amd64/md5 ] && rm -f $BASEDIR/kernel/crypto/amd64/md5
	else
	    chmod 0755 "$BASEDIR/kernel/crypto/amd64/md5"
	    chown root:sys "$BASEDIR/kernel/crypto/amd64/md5"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/crypto/amd64/rsa ] && rm -f $BASEDIR/kernel/crypto/amd64/rsa
	else
	    chmod 0755 "$BASEDIR/kernel/crypto/amd64/rsa"
	    chown root:sys "$BASEDIR/kernel/crypto/amd64/rsa"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/crypto/amd64/sha1 ] && rm -f $BASEDIR/kernel/crypto/amd64/sha1
	else
	    chmod 0755 "$BASEDIR/kernel/crypto/amd64/sha1"
	    chown root:sys "$BASEDIR/kernel/crypto/amd64/sha1"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/crypto/amd64/sha2 ] && rm -f $BASEDIR/kernel/crypto/amd64/sha2
	else
	    chmod 0755 "$BASEDIR/kernel/crypto/amd64/sha2"
	    chown root:sys "$BASEDIR/kernel/crypto/amd64/sha2"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/crypto/amd64/skein ] && rm -f $BASEDIR/kernel/crypto/amd64/skein
	else
	    chmod 0755 "$BASEDIR/kernel/crypto/amd64/skein"
	    chown root:sys "$BASEDIR/kernel/crypto/amd64/skein"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/crypto/amd64/swrand ] && rm -f $BASEDIR/kernel/crypto/amd64/swrand
	else
	    chmod 0755 "$BASEDIR/kernel/crypto/amd64/swrand"
	    chown root:sys "$BASEDIR/kernel/crypto/amd64/swrand"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/dacf/amd64/net_dacf ] && rm -f $BASEDIR/kernel/dacf/amd64/net_dacf
	else
	    chmod 0755 "$BASEDIR/kernel/dacf/amd64/net_dacf"
	    chown root:sys "$BASEDIR/kernel/dacf/amd64/net_dacf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/acpi_drv ] && rm -f $BASEDIR/kernel/drv/amd64/acpi_drv
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/acpi_drv"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/acpi_drv"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/acpi_toshiba ] && rm -f $BASEDIR/kernel/drv/amd64/acpi_toshiba
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/acpi_toshiba"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/acpi_toshiba"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/aggr ] && rm -f $BASEDIR/kernel/drv/amd64/aggr
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/aggr"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/aggr"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/arp ] && rm -f $BASEDIR/kernel/drv/amd64/arp
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/arp"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/arp"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/bl ] && rm -f $BASEDIR/kernel/drv/amd64/bl
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/bl"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/bl"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/bridge ] && rm -f $BASEDIR/kernel/drv/amd64/bridge
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/bridge"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/bridge"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/cn ] && rm -f $BASEDIR/kernel/drv/amd64/cn
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/cn"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/cn"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/conskbd ] && rm -f $BASEDIR/kernel/drv/amd64/conskbd
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/conskbd"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/conskbd"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/consms ] && rm -f $BASEDIR/kernel/drv/amd64/consms
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/consms"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/consms"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/cpuid ] && rm -f $BASEDIR/kernel/drv/amd64/cpuid
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/cpuid"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/cpuid"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/cpunex ] && rm -f $BASEDIR/kernel/drv/amd64/cpunex
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/cpunex"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/cpunex"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/crypto ] && rm -f $BASEDIR/kernel/drv/amd64/crypto
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/crypto"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/crypto"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/cryptoadm ] && rm -f $BASEDIR/kernel/drv/amd64/cryptoadm
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/cryptoadm"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/cryptoadm"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/devinfo ] && rm -f $BASEDIR/kernel/drv/amd64/devinfo
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/devinfo"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/devinfo"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/dld ] && rm -f $BASEDIR/kernel/drv/amd64/dld
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/dld"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/dld"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/dlpistub ] && rm -f $BASEDIR/kernel/drv/amd64/dlpistub
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/dlpistub"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/dlpistub"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/i8042 ] && rm -f $BASEDIR/kernel/drv/amd64/i8042
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/i8042"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/i8042"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/icmp ] && rm -f $BASEDIR/kernel/drv/amd64/icmp
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/icmp"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/icmp"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/icmp6 ] && rm -f $BASEDIR/kernel/drv/amd64/icmp6
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/icmp6"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/icmp6"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/intel_nb5000 ] && rm -f $BASEDIR/kernel/drv/amd64/intel_nb5000
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/intel_nb5000"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/intel_nb5000"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/intel_nhm ] && rm -f $BASEDIR/kernel/drv/amd64/intel_nhm
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/intel_nhm"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/intel_nhm"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/intel_nhmex ] && rm -f $BASEDIR/kernel/drv/amd64/intel_nhmex
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/intel_nhmex"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/intel_nhmex"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/ip ] && rm -f $BASEDIR/kernel/drv/amd64/ip
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/ip"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/ip"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/ip6 ] && rm -f $BASEDIR/kernel/drv/amd64/ip6
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/ip6"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/ip6"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/ipnet ] && rm -f $BASEDIR/kernel/drv/amd64/ipnet
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/ipnet"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/ipnet"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/ippctl ] && rm -f $BASEDIR/kernel/drv/amd64/ippctl
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/ippctl"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/ippctl"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/ipsecah ] && rm -f $BASEDIR/kernel/drv/amd64/ipsecah
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/ipsecah"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/ipsecah"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/ipsecesp ] && rm -f $BASEDIR/kernel/drv/amd64/ipsecesp
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/ipsecesp"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/ipsecesp"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/iptun ] && rm -f $BASEDIR/kernel/drv/amd64/iptun
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/iptun"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/iptun"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/iwscn ] && rm -f $BASEDIR/kernel/drv/amd64/iwscn
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/iwscn"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/iwscn"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/kb8042 ] && rm -f $BASEDIR/kernel/drv/amd64/kb8042
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/kb8042"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/kb8042"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/keysock ] && rm -f $BASEDIR/kernel/drv/amd64/keysock
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/keysock"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/keysock"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/kmdb ] && rm -f $BASEDIR/kernel/drv/amd64/kmdb
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/kmdb"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/kmdb"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/ksensor ] && rm -f $BASEDIR/kernel/drv/amd64/ksensor
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/ksensor"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/ksensor"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/llc1 ] && rm -f $BASEDIR/kernel/drv/amd64/llc1
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/llc1"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/llc1"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/lofi ] && rm -f $BASEDIR/kernel/drv/amd64/lofi
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/lofi"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/lofi"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/log ] && rm -f $BASEDIR/kernel/drv/amd64/log
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/log"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/log"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/mc-amd ] && rm -f $BASEDIR/kernel/drv/amd64/mc-amd
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/mc-amd"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/mc-amd"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/mm ] && rm -f $BASEDIR/kernel/drv/amd64/mm
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/mm"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/mm"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/mouse8042 ] && rm -f $BASEDIR/kernel/drv/amd64/mouse8042
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/mouse8042"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/mouse8042"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/mpt ] && rm -f $BASEDIR/kernel/drv/amd64/mpt
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/mpt"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/mpt"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/nulldriver ] && rm -f $BASEDIR/kernel/drv/amd64/nulldriver
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/nulldriver"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/nulldriver"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/openeepr ] && rm -f $BASEDIR/kernel/drv/amd64/openeepr
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/openeepr"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/openeepr"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/options ] && rm -f $BASEDIR/kernel/drv/amd64/options
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/options"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/options"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/pci_pci ] && rm -f $BASEDIR/kernel/drv/amd64/pci_pci
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/pci_pci"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/pci_pci"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/pcieb ] && rm -f $BASEDIR/kernel/drv/amd64/pcieb
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/pcieb"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/pcieb"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/physmem ] && rm -f $BASEDIR/kernel/drv/amd64/physmem
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/physmem"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/physmem"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/poll ] && rm -f $BASEDIR/kernel/drv/amd64/poll
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/poll"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/poll"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/power ] && rm -f $BASEDIR/kernel/drv/amd64/power
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/power"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/power"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/pseudo ] && rm -f $BASEDIR/kernel/drv/amd64/pseudo
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/pseudo"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/pseudo"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/ptc ] && rm -f $BASEDIR/kernel/drv/amd64/ptc
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/ptc"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/ptc"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/ptsl ] && rm -f $BASEDIR/kernel/drv/amd64/ptsl
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/ptsl"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/ptsl"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/ramdisk ] && rm -f $BASEDIR/kernel/drv/amd64/ramdisk
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/ramdisk"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/ramdisk"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/random ] && rm -f $BASEDIR/kernel/drv/amd64/random
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/random"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/random"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/rts ] && rm -f $BASEDIR/kernel/drv/amd64/rts
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/rts"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/rts"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/sad ] && rm -f $BASEDIR/kernel/drv/amd64/sad
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/sad"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/sad"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/scsi_vhci ] && rm -f $BASEDIR/kernel/drv/amd64/scsi_vhci
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/scsi_vhci"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/scsi_vhci"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/sd ] && rm -f $BASEDIR/kernel/drv/amd64/sd
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/sd"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/sd"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/sgen ] && rm -f $BASEDIR/kernel/drv/amd64/sgen
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/sgen"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/sgen"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/simnet ] && rm -f $BASEDIR/kernel/drv/amd64/simnet
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/simnet"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/simnet"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/smbios ] && rm -f $BASEDIR/kernel/drv/amd64/smbios
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/smbios"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/smbios"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/softmac ] && rm -f $BASEDIR/kernel/drv/amd64/softmac
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/softmac"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/softmac"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/spdsock ] && rm -f $BASEDIR/kernel/drv/amd64/spdsock
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/spdsock"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/spdsock"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/st ] && rm -f $BASEDIR/kernel/drv/amd64/st
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/st"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/st"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/sy ] && rm -f $BASEDIR/kernel/drv/amd64/sy
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/sy"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/sy"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/sysevent ] && rm -f $BASEDIR/kernel/drv/amd64/sysevent
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/sysevent"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/sysevent"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/sysmsg ] && rm -f $BASEDIR/kernel/drv/amd64/sysmsg
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/sysmsg"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/sysmsg"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/tcp ] && rm -f $BASEDIR/kernel/drv/amd64/tcp
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/tcp"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/tcp"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/tcp6 ] && rm -f $BASEDIR/kernel/drv/amd64/tcp6
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/tcp6"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/tcp6"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/tl ] && rm -f $BASEDIR/kernel/drv/amd64/tl
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/tl"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/tl"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/tzmon ] && rm -f $BASEDIR/kernel/drv/amd64/tzmon
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/tzmon"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/tzmon"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/ucode ] && rm -f $BASEDIR/kernel/drv/amd64/ucode
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/ucode"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/ucode"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/udp ] && rm -f $BASEDIR/kernel/drv/amd64/udp
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/udp"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/udp"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/udp6 ] && rm -f $BASEDIR/kernel/drv/amd64/udp6
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/udp6"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/udp6"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/ufm ] && rm -f $BASEDIR/kernel/drv/amd64/ufm
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/ufm"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/ufm"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/vgatext ] && rm -f $BASEDIR/kernel/drv/amd64/vgatext
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/vgatext"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/vgatext"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/vnd ] && rm -f $BASEDIR/kernel/drv/amd64/vnd
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/vnd"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/vnd"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/vnic ] && rm -f $BASEDIR/kernel/drv/amd64/vnic
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/vnic"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/vnic"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/drv/amd64/wc ] && rm -f $BASEDIR/kernel/drv/amd64/wc
	else
	    chmod 0755 "$BASEDIR/kernel/drv/amd64/wc"
	    chown root:sys "$BASEDIR/kernel/drv/amd64/wc"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/exec/amd64/elfexec ] && rm -f $BASEDIR/kernel/exec/amd64/elfexec
	else
	    chmod 0755 "$BASEDIR/kernel/exec/amd64/elfexec"
	    chown root:sys "$BASEDIR/kernel/exec/amd64/elfexec"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/exec/amd64/intpexec ] && rm -f $BASEDIR/kernel/exec/amd64/intpexec
	else
	    chmod 0755 "$BASEDIR/kernel/exec/amd64/intpexec"
	    chown root:sys "$BASEDIR/kernel/exec/amd64/intpexec"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/autofs ] && rm -f $BASEDIR/kernel/fs/amd64/autofs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/autofs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/autofs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/ctfs ] && rm -f $BASEDIR/kernel/fs/amd64/ctfs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/ctfs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/ctfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/dcfs ] && rm -f $BASEDIR/kernel/fs/amd64/dcfs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/dcfs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/dcfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/dev ] && rm -f $BASEDIR/kernel/fs/amd64/dev
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/dev"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/dev"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/devfs ] && rm -f $BASEDIR/kernel/fs/amd64/devfs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/devfs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/devfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/fifofs ] && rm -f $BASEDIR/kernel/fs/amd64/fifofs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/fifofs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/fifofs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/hsfs ] && rm -f $BASEDIR/kernel/fs/amd64/hsfs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/hsfs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/hsfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/hyprlofs ] && rm -f $BASEDIR/kernel/fs/amd64/hyprlofs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/hyprlofs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/hyprlofs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/lofs ] && rm -f $BASEDIR/kernel/fs/amd64/lofs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/lofs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/lofs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/lxprocfs ] && rm -f $BASEDIR/kernel/fs/amd64/lxprocfs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/lxprocfs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/lxprocfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/mntfs ] && rm -f $BASEDIR/kernel/fs/amd64/mntfs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/mntfs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/mntfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/namefs ] && rm -f $BASEDIR/kernel/fs/amd64/namefs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/namefs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/namefs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/objfs ] && rm -f $BASEDIR/kernel/fs/amd64/objfs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/objfs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/objfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/procfs ] && rm -f $BASEDIR/kernel/fs/amd64/procfs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/procfs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/procfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/sharefs ] && rm -f $BASEDIR/kernel/fs/amd64/sharefs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/sharefs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/sharefs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/sockfs ] && rm -f $BASEDIR/kernel/fs/amd64/sockfs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/sockfs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/sockfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/specfs ] && rm -f $BASEDIR/kernel/fs/amd64/specfs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/specfs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/specfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/tmpfs ] && rm -f $BASEDIR/kernel/fs/amd64/tmpfs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/tmpfs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/tmpfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/fs/amd64/ufs ] && rm -f $BASEDIR/kernel/fs/amd64/ufs
	else
	    chmod 0755 "$BASEDIR/kernel/fs/amd64/ufs"
	    chown root:sys "$BASEDIR/kernel/fs/amd64/ufs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/ipp/amd64/ipgpc ] && rm -f $BASEDIR/kernel/ipp/amd64/ipgpc
	else
	    chmod 0755 "$BASEDIR/kernel/ipp/amd64/ipgpc"
	    chown root:sys "$BASEDIR/kernel/ipp/amd64/ipgpc"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kiconv/amd64/kiconv_emea ] && rm -f $BASEDIR/kernel/kiconv/amd64/kiconv_emea
	else
	    chmod 0755 "$BASEDIR/kernel/kiconv/amd64/kiconv_emea"
	    chown root:sys "$BASEDIR/kernel/kiconv/amd64/kiconv_emea"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kiconv/amd64/kiconv_ja ] && rm -f $BASEDIR/kernel/kiconv/amd64/kiconv_ja
	else
	    chmod 0755 "$BASEDIR/kernel/kiconv/amd64/kiconv_ja"
	    chown root:sys "$BASEDIR/kernel/kiconv/amd64/kiconv_ja"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kiconv/amd64/kiconv_ko ] && rm -f $BASEDIR/kernel/kiconv/amd64/kiconv_ko
	else
	    chmod 0755 "$BASEDIR/kernel/kiconv/amd64/kiconv_ko"
	    chown root:sys "$BASEDIR/kernel/kiconv/amd64/kiconv_ko"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kiconv/amd64/kiconv_sc ] && rm -f $BASEDIR/kernel/kiconv/amd64/kiconv_sc
	else
	    chmod 0755 "$BASEDIR/kernel/kiconv/amd64/kiconv_sc"
	    chown root:sys "$BASEDIR/kernel/kiconv/amd64/kiconv_sc"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/kiconv/amd64/kiconv_tc ] && rm -f $BASEDIR/kernel/kiconv/amd64/kiconv_tc
	else
	    chmod 0755 "$BASEDIR/kernel/kiconv/amd64/kiconv_tc"
	    chown root:sys "$BASEDIR/kernel/kiconv/amd64/kiconv_tc"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/mac/amd64/mac_6to4 ] && rm -f $BASEDIR/kernel/mac/amd64/mac_6to4
	else
	    chmod 0755 "$BASEDIR/kernel/mac/amd64/mac_6to4"
	    chown root:sys "$BASEDIR/kernel/mac/amd64/mac_6to4"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/mac/amd64/mac_ether ] && rm -f $BASEDIR/kernel/mac/amd64/mac_ether
	else
	    chmod 0755 "$BASEDIR/kernel/mac/amd64/mac_ether"
	    chown root:sys "$BASEDIR/kernel/mac/amd64/mac_ether"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/mac/amd64/mac_ib ] && rm -f $BASEDIR/kernel/mac/amd64/mac_ib
	else
	    chmod 0755 "$BASEDIR/kernel/mac/amd64/mac_ib"
	    chown root:sys "$BASEDIR/kernel/mac/amd64/mac_ib"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/mac/amd64/mac_ipv4 ] && rm -f $BASEDIR/kernel/mac/amd64/mac_ipv4
	else
	    chmod 0755 "$BASEDIR/kernel/mac/amd64/mac_ipv4"
	    chown root:sys "$BASEDIR/kernel/mac/amd64/mac_ipv4"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/mac/amd64/mac_ipv6 ] && rm -f $BASEDIR/kernel/mac/amd64/mac_ipv6
	else
	    chmod 0755 "$BASEDIR/kernel/mac/amd64/mac_ipv6"
	    chown root:sys "$BASEDIR/kernel/mac/amd64/mac_ipv6"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/mac/amd64/mac_wifi ] && rm -f $BASEDIR/kernel/mac/amd64/mac_wifi
	else
	    chmod 0755 "$BASEDIR/kernel/mac/amd64/mac_wifi"
	    chown root:sys "$BASEDIR/kernel/mac/amd64/mac_wifi"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/acpica ] && rm -f $BASEDIR/kernel/misc/amd64/acpica
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/acpica"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/acpica"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/bignum ] && rm -f $BASEDIR/kernel/misc/amd64/bignum
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/bignum"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/bignum"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/bootdev ] && rm -f $BASEDIR/kernel/misc/amd64/bootdev
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/bootdev"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/bootdev"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/busra ] && rm -f $BASEDIR/kernel/misc/amd64/busra
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/busra"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/busra"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/cardbus ] && rm -f $BASEDIR/kernel/misc/amd64/cardbus
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/cardbus"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/cardbus"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/cc ] && rm -f $BASEDIR/kernel/misc/amd64/cc
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/cc"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/cc"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/cmlb ] && rm -f $BASEDIR/kernel/misc/amd64/cmlb
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/cmlb"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/cmlb"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/consconfig ] && rm -f $BASEDIR/kernel/misc/amd64/consconfig
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/consconfig"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/consconfig"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/ctf ] && rm -f $BASEDIR/kernel/misc/amd64/ctf
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/ctf"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/ctf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/dls ] && rm -f $BASEDIR/kernel/misc/amd64/dls
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/dls"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/dls"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/fssnap_if ] && rm -f $BASEDIR/kernel/misc/amd64/fssnap_if
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/fssnap_if"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/fssnap_if"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/gld ] && rm -f $BASEDIR/kernel/misc/amd64/gld
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/gld"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/gld"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/gsqueue ] && rm -f $BASEDIR/kernel/misc/amd64/gsqueue
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/gsqueue"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/gsqueue"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/hook ] && rm -f $BASEDIR/kernel/misc/amd64/hook
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/hook"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/hook"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/hpcsvc ] && rm -f $BASEDIR/kernel/misc/amd64/hpcsvc
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/hpcsvc"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/hpcsvc"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/idmap ] && rm -f $BASEDIR/kernel/misc/amd64/idmap
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/idmap"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/idmap"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/iommulib ] && rm -f $BASEDIR/kernel/misc/amd64/iommulib
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/iommulib"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/iommulib"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/ipc ] && rm -f $BASEDIR/kernel/misc/amd64/ipc
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/ipc"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/ipc"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/kbtrans ] && rm -f $BASEDIR/kernel/misc/amd64/kbtrans
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/kbtrans"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/kbtrans"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/kcf ] && rm -f $BASEDIR/kernel/misc/amd64/kcf
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/kcf"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/kcf"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/kmdbmod ] && rm -f $BASEDIR/kernel/misc/amd64/kmdbmod
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/kmdbmod"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/kmdbmod"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/ksocket ] && rm -f $BASEDIR/kernel/misc/amd64/ksocket
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/ksocket"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/ksocket"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/mac ] && rm -f $BASEDIR/kernel/misc/amd64/mac
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/mac"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/mac"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/mii ] && rm -f $BASEDIR/kernel/misc/amd64/mii
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/mii"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/mii"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/net80211 ] && rm -f $BASEDIR/kernel/misc/amd64/net80211
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/net80211"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/net80211"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/neti ] && rm -f $BASEDIR/kernel/misc/amd64/neti
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/neti"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/neti"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/pci_autoconfig ] && rm -f $BASEDIR/kernel/misc/amd64/pci_autoconfig
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/pci_autoconfig"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/pci_autoconfig"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/pcicfg ] && rm -f $BASEDIR/kernel/misc/amd64/pcicfg
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/pcicfg"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/pcicfg"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/pcie ] && rm -f $BASEDIR/kernel/misc/amd64/pcie
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/pcie"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/pcie"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/pcihp ] && rm -f $BASEDIR/kernel/misc/amd64/pcihp
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/pcihp"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/pcihp"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/pcmcia ] && rm -f $BASEDIR/kernel/misc/amd64/pcmcia
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/pcmcia"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/pcmcia"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/rpcsec ] && rm -f $BASEDIR/kernel/misc/amd64/rpcsec
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/rpcsec"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/rpcsec"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/sata ] && rm -f $BASEDIR/kernel/misc/amd64/sata
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/sata"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/sata"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/scsi ] && rm -f $BASEDIR/kernel/misc/amd64/scsi
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/scsi"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/scsi"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/strplumb ] && rm -f $BASEDIR/kernel/misc/amd64/strplumb
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/strplumb"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/strplumb"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/tem ] && rm -f $BASEDIR/kernel/misc/amd64/tem
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/tem"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/tem"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/amd64/tlimod ] && rm -f $BASEDIR/kernel/misc/amd64/tlimod
	else
	    chmod 0755 "$BASEDIR/kernel/misc/amd64/tlimod"
	    chown root:sys "$BASEDIR/kernel/misc/amd64/tlimod"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_asym_emc ] && rm -f $BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_asym_emc
	else
	    chmod 0755 "$BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_asym_emc"
	    chown root:sys "$BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_asym_emc"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_asym_lsi ] && rm -f $BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_asym_lsi
	else
	    chmod 0755 "$BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_asym_lsi"
	    chown root:sys "$BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_asym_lsi"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_sym ] && rm -f $BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_sym
	else
	    chmod 0755 "$BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_sym"
	    chown root:sys "$BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_sym"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_sym_emc ] && rm -f $BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_sym_emc
	else
	    chmod 0755 "$BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_sym_emc"
	    chown root:sys "$BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_sym_emc"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_sym_hds ] && rm -f $BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_sym_hds
	else
	    chmod 0755 "$BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_sym_hds"
	    chown root:sys "$BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_sym_hds"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_tape ] && rm -f $BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_tape
	else
	    chmod 0755 "$BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_tape"
	    chown root:sys "$BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_tape"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_tpgs ] && rm -f $BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_tpgs
	else
	    chmod 0755 "$BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_tpgs"
	    chown root:sys "$BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_tpgs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_tpgs_tape ] && rm -f $BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_tpgs_tape
	else
	    chmod 0755 "$BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_tpgs_tape"
	    chown root:sys "$BASEDIR/kernel/misc/scsi_vhci/amd64/scsi_vhci_f_tpgs_tape"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/sched/amd64/SDC ] && rm -f $BASEDIR/kernel/sched/amd64/SDC
	else
	    chmod 0755 "$BASEDIR/kernel/sched/amd64/SDC"
	    chown root:sys "$BASEDIR/kernel/sched/amd64/SDC"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/sched/amd64/TS ] && rm -f $BASEDIR/kernel/sched/amd64/TS
	else
	    chmod 0755 "$BASEDIR/kernel/sched/amd64/TS"
	    chown root:sys "$BASEDIR/kernel/sched/amd64/TS"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/sched/amd64/TS_DPTBL ] && rm -f $BASEDIR/kernel/sched/amd64/TS_DPTBL
	else
	    chmod 0755 "$BASEDIR/kernel/sched/amd64/TS_DPTBL"
	    chown root:sys "$BASEDIR/kernel/sched/amd64/TS_DPTBL"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/socketmod/amd64/datafilt ] && rm -f $BASEDIR/kernel/socketmod/amd64/datafilt
	else
	    chmod 0755 "$BASEDIR/kernel/socketmod/amd64/datafilt"
	    chown root:sys "$BASEDIR/kernel/socketmod/amd64/datafilt"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/socketmod/amd64/socksctp ] && rm -f $BASEDIR/kernel/socketmod/amd64/socksctp
	else
	    chmod 0755 "$BASEDIR/kernel/socketmod/amd64/socksctp"
	    chown root:sys "$BASEDIR/kernel/socketmod/amd64/socksctp"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/socketmod/amd64/trill ] && rm -f $BASEDIR/kernel/socketmod/amd64/trill
	else
	    chmod 0755 "$BASEDIR/kernel/socketmod/amd64/trill"
	    chown root:sys "$BASEDIR/kernel/socketmod/amd64/trill"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/strmod/amd64/bufmod ] && rm -f $BASEDIR/kernel/strmod/amd64/bufmod
	else
	    chmod 0755 "$BASEDIR/kernel/strmod/amd64/bufmod"
	    chown root:sys "$BASEDIR/kernel/strmod/amd64/bufmod"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/strmod/amd64/connld ] && rm -f $BASEDIR/kernel/strmod/amd64/connld
	else
	    chmod 0755 "$BASEDIR/kernel/strmod/amd64/connld"
	    chown root:sys "$BASEDIR/kernel/strmod/amd64/connld"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/strmod/amd64/dedump ] && rm -f $BASEDIR/kernel/strmod/amd64/dedump
	else
	    chmod 0755 "$BASEDIR/kernel/strmod/amd64/dedump"
	    chown root:sys "$BASEDIR/kernel/strmod/amd64/dedump"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/strmod/amd64/drcompat ] && rm -f $BASEDIR/kernel/strmod/amd64/drcompat
	else
	    chmod 0755 "$BASEDIR/kernel/strmod/amd64/drcompat"
	    chown root:sys "$BASEDIR/kernel/strmod/amd64/drcompat"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/strmod/amd64/ldterm ] && rm -f $BASEDIR/kernel/strmod/amd64/ldterm
	else
	    chmod 0755 "$BASEDIR/kernel/strmod/amd64/ldterm"
	    chown root:sys "$BASEDIR/kernel/strmod/amd64/ldterm"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/strmod/amd64/pckt ] && rm -f $BASEDIR/kernel/strmod/amd64/pckt
	else
	    chmod 0755 "$BASEDIR/kernel/strmod/amd64/pckt"
	    chown root:sys "$BASEDIR/kernel/strmod/amd64/pckt"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/strmod/amd64/pfmod ] && rm -f $BASEDIR/kernel/strmod/amd64/pfmod
	else
	    chmod 0755 "$BASEDIR/kernel/strmod/amd64/pfmod"
	    chown root:sys "$BASEDIR/kernel/strmod/amd64/pfmod"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/strmod/amd64/pipemod ] && rm -f $BASEDIR/kernel/strmod/amd64/pipemod
	else
	    chmod 0755 "$BASEDIR/kernel/strmod/amd64/pipemod"
	    chown root:sys "$BASEDIR/kernel/strmod/amd64/pipemod"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/strmod/amd64/ptem ] && rm -f $BASEDIR/kernel/strmod/amd64/ptem
	else
	    chmod 0755 "$BASEDIR/kernel/strmod/amd64/ptem"
	    chown root:sys "$BASEDIR/kernel/strmod/amd64/ptem"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/strmod/amd64/redirmod ] && rm -f $BASEDIR/kernel/strmod/amd64/redirmod
	else
	    chmod 0755 "$BASEDIR/kernel/strmod/amd64/redirmod"
	    chown root:sys "$BASEDIR/kernel/strmod/amd64/redirmod"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/strmod/amd64/rpcmod ] && rm -f $BASEDIR/kernel/strmod/amd64/rpcmod
	else
	    chmod 0755 "$BASEDIR/kernel/strmod/amd64/rpcmod"
	    chown root:sys "$BASEDIR/kernel/strmod/amd64/rpcmod"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/strmod/amd64/timod ] && rm -f $BASEDIR/kernel/strmod/amd64/timod
	else
	    chmod 0755 "$BASEDIR/kernel/strmod/amd64/timod"
	    chown root:sys "$BASEDIR/kernel/strmod/amd64/timod"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/strmod/amd64/tirdwr ] && rm -f $BASEDIR/kernel/strmod/amd64/tirdwr
	else
	    chmod 0755 "$BASEDIR/kernel/strmod/amd64/tirdwr"
	    chown root:sys "$BASEDIR/kernel/strmod/amd64/tirdwr"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/strmod/amd64/ttcompat ] && rm -f $BASEDIR/kernel/strmod/amd64/ttcompat
	else
	    chmod 0755 "$BASEDIR/kernel/strmod/amd64/ttcompat"
	    chown root:sys "$BASEDIR/kernel/strmod/amd64/ttcompat"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/sys/amd64/c2audit ] && rm -f $BASEDIR/kernel/sys/amd64/c2audit
	else
	    chmod 0755 "$BASEDIR/kernel/sys/amd64/c2audit"
	    chown root:sys "$BASEDIR/kernel/sys/amd64/c2audit"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/sys/amd64/doorfs ] && rm -f $BASEDIR/kernel/sys/amd64/doorfs
	else
	    chmod 0755 "$BASEDIR/kernel/sys/amd64/doorfs"
	    chown root:sys "$BASEDIR/kernel/sys/amd64/doorfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/sys/amd64/inst_sync ] && rm -f $BASEDIR/kernel/sys/amd64/inst_sync
	else
	    chmod 0755 "$BASEDIR/kernel/sys/amd64/inst_sync"
	    chown root:sys "$BASEDIR/kernel/sys/amd64/inst_sync"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/sys/amd64/kaio ] && rm -f $BASEDIR/kernel/sys/amd64/kaio
	else
	    chmod 0755 "$BASEDIR/kernel/sys/amd64/kaio"
	    chown root:sys "$BASEDIR/kernel/sys/amd64/kaio"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/sys/amd64/msgsys ] && rm -f $BASEDIR/kernel/sys/amd64/msgsys
	else
	    chmod 0755 "$BASEDIR/kernel/sys/amd64/msgsys"
	    chown root:sys "$BASEDIR/kernel/sys/amd64/msgsys"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/sys/amd64/pipe ] && rm -f $BASEDIR/kernel/sys/amd64/pipe
	else
	    chmod 0755 "$BASEDIR/kernel/sys/amd64/pipe"
	    chown root:sys "$BASEDIR/kernel/sys/amd64/pipe"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/sys/amd64/portfs ] && rm -f $BASEDIR/kernel/sys/amd64/portfs
	else
	    chmod 0755 "$BASEDIR/kernel/sys/amd64/portfs"
	    chown root:sys "$BASEDIR/kernel/sys/amd64/portfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/sys/amd64/pset ] && rm -f $BASEDIR/kernel/sys/amd64/pset
	else
	    chmod 0755 "$BASEDIR/kernel/sys/amd64/pset"
	    chown root:sys "$BASEDIR/kernel/sys/amd64/pset"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/sys/amd64/semsys ] && rm -f $BASEDIR/kernel/sys/amd64/semsys
	else
	    chmod 0755 "$BASEDIR/kernel/sys/amd64/semsys"
	    chown root:sys "$BASEDIR/kernel/sys/amd64/semsys"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/kernel/sys/amd64/shmsys ] && rm -f $BASEDIR/kernel/sys/amd64/shmsys
	else
	    chmod 0755 "$BASEDIR/kernel/sys/amd64/shmsys"
	    chown root:sys "$BASEDIR/kernel/sys/amd64/shmsys"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/amd64/dump ] && rm -f $BASEDIR/usr/kernel/drv/amd64/dump
	else
	    chmod 0755 "$BASEDIR/usr/kernel/drv/amd64/dump"
	    chown root:sys "$BASEDIR/usr/kernel/drv/amd64/dump"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/amd64/eventfd ] && rm -f $BASEDIR/usr/kernel/drv/amd64/eventfd
	else
	    chmod 0755 "$BASEDIR/usr/kernel/drv/amd64/eventfd"
	    chown root:sys "$BASEDIR/usr/kernel/drv/amd64/eventfd"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/amd64/fssnap ] && rm -f $BASEDIR/usr/kernel/drv/amd64/fssnap
	else
	    chmod 0755 "$BASEDIR/usr/kernel/drv/amd64/fssnap"
	    chown root:sys "$BASEDIR/usr/kernel/drv/amd64/fssnap"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/amd64/inotify ] && rm -f $BASEDIR/usr/kernel/drv/amd64/inotify
	else
	    chmod 0755 "$BASEDIR/usr/kernel/drv/amd64/inotify"
	    chown root:sys "$BASEDIR/usr/kernel/drv/amd64/inotify"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/amd64/kstat ] && rm -f $BASEDIR/usr/kernel/drv/amd64/kstat
	else
	    chmod 0755 "$BASEDIR/usr/kernel/drv/amd64/kstat"
	    chown root:sys "$BASEDIR/usr/kernel/drv/amd64/kstat"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/amd64/ksyms ] && rm -f $BASEDIR/usr/kernel/drv/amd64/ksyms
	else
	    chmod 0755 "$BASEDIR/usr/kernel/drv/amd64/ksyms"
	    chown root:sys "$BASEDIR/usr/kernel/drv/amd64/ksyms"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/amd64/logindmux ] && rm -f $BASEDIR/usr/kernel/drv/amd64/logindmux
	else
	    chmod 0755 "$BASEDIR/usr/kernel/drv/amd64/logindmux"
	    chown root:sys "$BASEDIR/usr/kernel/drv/amd64/logindmux"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/amd64/ptm ] && rm -f $BASEDIR/usr/kernel/drv/amd64/ptm
	else
	    chmod 0755 "$BASEDIR/usr/kernel/drv/amd64/ptm"
	    chown root:sys "$BASEDIR/usr/kernel/drv/amd64/ptm"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/amd64/pts ] && rm -f $BASEDIR/usr/kernel/drv/amd64/pts
	else
	    chmod 0755 "$BASEDIR/usr/kernel/drv/amd64/pts"
	    chown root:sys "$BASEDIR/usr/kernel/drv/amd64/pts"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/amd64/signalfd ] && rm -f $BASEDIR/usr/kernel/drv/amd64/signalfd
	else
	    chmod 0755 "$BASEDIR/usr/kernel/drv/amd64/signalfd"
	    chown root:sys "$BASEDIR/usr/kernel/drv/amd64/signalfd"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/drv/amd64/timerfd ] && rm -f $BASEDIR/usr/kernel/drv/amd64/timerfd
	else
	    chmod 0755 "$BASEDIR/usr/kernel/drv/amd64/timerfd"
	    chown root:sys "$BASEDIR/usr/kernel/drv/amd64/timerfd"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/exec/amd64/javaexec ] && rm -f $BASEDIR/usr/kernel/exec/amd64/javaexec
	else
	    chmod 0755 "$BASEDIR/usr/kernel/exec/amd64/javaexec"
	    chown root:sys "$BASEDIR/usr/kernel/exec/amd64/javaexec"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/exec/amd64/shbinexec ] && rm -f $BASEDIR/usr/kernel/exec/amd64/shbinexec
	else
	    chmod 0755 "$BASEDIR/usr/kernel/exec/amd64/shbinexec"
	    chown root:sys "$BASEDIR/usr/kernel/exec/amd64/shbinexec"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/fs/amd64/fdfs ] && rm -f $BASEDIR/usr/kernel/fs/amd64/fdfs
	else
	    chmod 0755 "$BASEDIR/usr/kernel/fs/amd64/fdfs"
	    chown root:sys "$BASEDIR/usr/kernel/fs/amd64/fdfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/fs/amd64/pcfs ] && rm -f $BASEDIR/usr/kernel/fs/amd64/pcfs
	else
	    chmod 0755 "$BASEDIR/usr/kernel/fs/amd64/pcfs"
	    chown root:sys "$BASEDIR/usr/kernel/fs/amd64/pcfs"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/sched/amd64/FX ] && rm -f $BASEDIR/usr/kernel/sched/amd64/FX
	else
	    chmod 0755 "$BASEDIR/usr/kernel/sched/amd64/FX"
	    chown root:sys "$BASEDIR/usr/kernel/sched/amd64/FX"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/sched/amd64/FX_DPTBL ] && rm -f $BASEDIR/usr/kernel/sched/amd64/FX_DPTBL
	else
	    chmod 0755 "$BASEDIR/usr/kernel/sched/amd64/FX_DPTBL"
	    chown root:sys "$BASEDIR/usr/kernel/sched/amd64/FX_DPTBL"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/sched/amd64/IA ] && rm -f $BASEDIR/usr/kernel/sched/amd64/IA
	else
	    chmod 0755 "$BASEDIR/usr/kernel/sched/amd64/IA"
	    chown root:sys "$BASEDIR/usr/kernel/sched/amd64/IA"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/sched/amd64/RT ] && rm -f $BASEDIR/usr/kernel/sched/amd64/RT
	else
	    chmod 0755 "$BASEDIR/usr/kernel/sched/amd64/RT"
	    chown root:sys "$BASEDIR/usr/kernel/sched/amd64/RT"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/sched/amd64/RT_DPTBL ] && rm -f $BASEDIR/usr/kernel/sched/amd64/RT_DPTBL
	else
	    chmod 0755 "$BASEDIR/usr/kernel/sched/amd64/RT_DPTBL"
	    chown root:sys "$BASEDIR/usr/kernel/sched/amd64/RT_DPTBL"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/strmod/amd64/cryptmod ] && rm -f $BASEDIR/usr/kernel/strmod/amd64/cryptmod
	else
	    chmod 0755 "$BASEDIR/usr/kernel/strmod/amd64/cryptmod"
	    chown root:sys "$BASEDIR/usr/kernel/strmod/amd64/cryptmod"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/strmod/amd64/rlmod ] && rm -f $BASEDIR/usr/kernel/strmod/amd64/rlmod
	else
	    chmod 0755 "$BASEDIR/usr/kernel/strmod/amd64/rlmod"
	    chown root:sys "$BASEDIR/usr/kernel/strmod/amd64/rlmod"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/strmod/amd64/telmod ] && rm -f $BASEDIR/usr/kernel/strmod/amd64/telmod
	else
	    chmod 0755 "$BASEDIR/usr/kernel/strmod/amd64/telmod"
	    chown root:sys "$BASEDIR/usr/kernel/strmod/amd64/telmod"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/sys/amd64/acctctl ] && rm -f $BASEDIR/usr/kernel/sys/amd64/acctctl
	else
	    chmod 0755 "$BASEDIR/usr/kernel/sys/amd64/acctctl"
	    chown root:sys "$BASEDIR/usr/kernel/sys/amd64/acctctl"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/sys/amd64/exacctsys ] && rm -f $BASEDIR/usr/kernel/sys/amd64/exacctsys
	else
	    chmod 0755 "$BASEDIR/usr/kernel/sys/amd64/exacctsys"
	    chown root:sys "$BASEDIR/usr/kernel/sys/amd64/exacctsys"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/kernel/sys/amd64/sysacct ] && rm -f $BASEDIR/usr/kernel/sys/amd64/sysacct
	else
	    chmod 0755 "$BASEDIR/usr/kernel/sys/amd64/sysacct"
	    chown root:sys "$BASEDIR/usr/kernel/sys/amd64/sysacct"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/lib/devfsadm/linkmod/SUNW_sensor_link.so ] && rm -f $BASEDIR/usr/lib/devfsadm/linkmod/SUNW_sensor_link.so
	else
	    chmod 0755 "$BASEDIR/usr/lib/devfsadm/linkmod/SUNW_sensor_link.so"
	    chown root:sys "$BASEDIR/usr/lib/devfsadm/linkmod/SUNW_sensor_link.so"
	fi
	if [ "$ZONEINST" = "1" ]; then
	    [ -f $BASEDIR/usr/lib/devfsadm/linkmod/SUNW_sensor_link.so ] && rm -f $BASEDIR/usr/lib/devfsadm/linkmod/SUNW_sensor_link.so
	else
	    chmod 0755 "$BASEDIR/usr/lib/devfsadm/linkmod/SUNW_sensor_link.so"
	    chown root:sys "$BASEDIR/usr/lib/devfsadm/linkmod/SUNW_sensor_link.so"
	fi
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/misc/amd64 && cd $BASEDIR/kernel/misc/amd64 && cp -f ../../../kernel/crypto/amd64/edonr edonr)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/misc/amd64 && cd $BASEDIR/kernel/misc/amd64 && cp -f ../../../kernel/crypto/amd64/md5 md5)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/misc/amd64 && cd $BASEDIR/kernel/misc/amd64 && cp -f ../../../kernel/crypto/amd64/sha1 sha1)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/misc/amd64 && cd $BASEDIR/kernel/misc/amd64 && cp -f ../../../kernel/crypto/amd64/sha2 sha2)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/misc/amd64 && cd $BASEDIR/kernel/misc/amd64 && cp -f ../../../kernel/crypto/amd64/skein skein)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/socketmod/amd64 && cd $BASEDIR/kernel/socketmod/amd64 && cp -f ../../../kernel/drv/amd64/icmp icmp)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/socketmod/amd64 && cd $BASEDIR/kernel/socketmod/amd64 && cp -f ../../../kernel/drv/amd64/rts rts)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/socketmod/amd64 && cd $BASEDIR/kernel/socketmod/amd64 && cp -f ../../../kernel/drv/amd64/tcp tcp)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/socketmod/amd64 && cd $BASEDIR/kernel/socketmod/amd64 && cp -f ../../../kernel/drv/amd64/udp udp)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/strmod/amd64 && cd $BASEDIR/kernel/strmod/amd64 && cp -f ../../../kernel/drv/amd64/arp arp)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/strmod/amd64 && cd $BASEDIR/kernel/strmod/amd64 && cp -f ../../../kernel/drv/amd64/icmp icmp)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/strmod/amd64 && cd $BASEDIR/kernel/strmod/amd64 && cp -f ../../../kernel/drv/amd64/ip ip)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/strmod/amd64 && cd $BASEDIR/kernel/strmod/amd64 && cp -f ../../../kernel/drv/amd64/ipsecah ipsecah)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/strmod/amd64 && cd $BASEDIR/kernel/strmod/amd64 && cp -f ../../../kernel/drv/amd64/ipsecesp ipsecesp)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/strmod/amd64 && cd $BASEDIR/kernel/strmod/amd64 && cp -f ../../../kernel/drv/amd64/keysock keysock)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/strmod/amd64 && cd $BASEDIR/kernel/strmod/amd64 && cp -f ../../../kernel/drv/amd64/tcp tcp)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/strmod/amd64 && cd $BASEDIR/kernel/strmod/amd64 && cp -f ../../../kernel/drv/amd64/udp udp)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/sys/amd64 && cd $BASEDIR/kernel/sys/amd64 && cp -f ../../../kernel/fs/amd64/autofs autofs)
	[ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/sys/amd64 && cd $BASEDIR/kernel/sys/amd64 && cp -f ../../../kernel/strmod/amd64/rpcmod rpcmod)
	[ "$ZONEINST" = "1" ] || (grep -c "^cpunex " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -i '"cpus"' cpunex ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^mpt " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -c 'scsi' -i '"pci1000,30" "pci1000,50" "pci1000,54" "pci1000,56" "pci1000,58" "pci1000,62" "pciex1000,56" "pciex1000,58" "pciex1000,62"' mpt ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^pci_pci " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -c 'pci' -i '"pci1011,1" "pci1011,21" "pci1014,22" "pciclass,060400" "pciclass,060401"' pci_pci ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^mc-amd " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -i '"pci1022,1100" "pci1022,1101" "pci1022,1102"' mc-amd ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^intel_nb5000 " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -i '"pci8086,25c0" "pci8086,25d0" "pci8086,25d4" "pci8086,25d8" "pci8086,3600" "pci8086,4000" "pci8086,4001" "pci8086,4003" "pci8086,65c0"' intel_nb5000 ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^intel_nhm " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -i '"pci8086,3423" "pci8086,372a"' intel_nhm ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^intel_nhmex " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -i '"pci8086,3438"' intel_nhmex ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^vgatext " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -i '"pciclass,000100" "pciclass,030000" "pciclass,030001"' vgatext ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^pcieb " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -i '"pciexclass,060400" "pciexclass,060401"' pcieb ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^kb8042 " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -i '"pnpPNP,303"' kb8042 ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^mouse8042 " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -i '"pnpPNP,f03"' mouse8042 ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^sgen " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -i '"scsa,08.bfcp" "scsa,08.bvhci"' -m '* 0600 root sys' sgen ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^nulldriver " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -i '"scsa,nodev" "scsa,probe"' nulldriver ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^sd " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -i '"scsiclass,00" "scsiclass,05"' -m '* 0640 root sys' sd ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^st " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -i '"scsiclass,01"' -m '* 0666 root sys' st ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^pseudo " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -i '"zconsnex" "zfdnex"' pseudo ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^scsi_vhci " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -c 'scsi-self-identifying' -m '* 0666 root sys' -p 'devctl write_priv_set=sys_devices' scsi_vhci ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^bridge " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -p 'read_priv_set=net_rawaccess write_priv_set=net_rawaccess' bridge ) )
	[ "$ZONEINST" = "1" ] || (grep -c "'bridge 0666 root sys'" $BASEDIR/etc/minor_perm >/dev/null || update_drv -n  -a $BASEDIR_OPT  -p 'read_priv_set=net_rawaccess write_priv_set=net_rawaccess' -m 'bridge 0666 root sys' clone)
	[ "$ZONEINST" = "1" ] || (grep -c "^llc1 " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  llc1 ) )
	[ "$ZONEINST" = "1" ] || (grep -c "'llc1 0666 root sys'" $BASEDIR/etc/minor_perm >/dev/null || update_drv -n  -a $BASEDIR_OPT  -m 'llc1 0666 root sys' clone)
	[ "$ZONEINST" = "1" ] || (grep -c "^ptm " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  ptm ) )
	[ "$ZONEINST" = "1" ] || (grep -c "'ptmx 0666 root sys'" $BASEDIR/etc/minor_perm >/dev/null || update_drv -n  -a $BASEDIR_OPT  -m 'ptmx 0666 root sys' clone)
	[ "$ZONEINST" = "1" ] || (grep -c "^simnet " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' simnet ) )
	[ "$ZONEINST" = "1" ] || (grep -c "'simnet 0666 root sys'" $BASEDIR/etc/minor_perm >/dev/null || update_drv -n  -a $BASEDIR_OPT  -m 'simnet 0666 root sys' clone)
	[ "$ZONEINST" = "1" ] || (grep -c "^tl " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' tl ) )
	[ "$ZONEINST" = "1" ] || (grep -c "'ticlts 0666 root sys'" $BASEDIR/etc/minor_perm >/dev/null || update_drv -n  -a $BASEDIR_OPT  -m 'ticlts 0666 root sys' clone)
	[ "$ZONEINST" = "1" ] || (grep -c "'ticots 0666 root sys'" $BASEDIR/etc/minor_perm >/dev/null || update_drv -n  -a $BASEDIR_OPT  -m 'ticots 0666 root sys' clone)
	[ "$ZONEINST" = "1" ] || (grep -c "'ticotsord 0666 root sys'" $BASEDIR/etc/minor_perm >/dev/null || update_drv -n  -a $BASEDIR_OPT  -m 'ticotsord 0666 root sys' clone)
	[ "$ZONEINST" = "1" ] || (grep -c "^vnic " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' vnic ) )
	[ "$ZONEINST" = "1" ] || (grep -c "'vnic 0666 root sys'" $BASEDIR/etc/minor_perm >/dev/null || update_drv -n  -a $BASEDIR_OPT  -m 'vnic 0666 root sys' clone)
	[ "$ZONEINST" = "1" ] || (grep -c "^acpi_drv " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' acpi_drv ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^aggr " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' aggr ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^arp " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'arp 0666 root sys' arp ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^bl " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' bl ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^cn " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0620 root tty' cn ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^conskbd " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'kbd 0666 root sys' conskbd ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^consms " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'mouse 0666 root sys' consms ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^cpuid " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'self 0644 root sys' cpuid ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^crypto " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'crypto 0666 root sys' crypto ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^cryptoadm " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'cryptoadm 0644 root sys' cryptoadm ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^devinfo " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'devinfo 0640 root sys','devinfo,ro 0444 root sys' devinfo ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^dld " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' dld ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^dlpistub " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' dlpistub ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^dump " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'dump 0660 root sys' dump ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^eventfd " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' eventfd ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^fssnap " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0640 root sys','ctl 0666 root sys' -p 'ctl read_priv_set=sys_config write_priv_set=sys_config' fssnap ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^i8042 " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  i8042 ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^icmp " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'icmp 0666 root sys' -p 'read_priv_set=net_icmpaccess write_priv_set=net_icmpaccess' icmp ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^icmp6 " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'icmp6 0666 root sys' -p 'read_priv_set=net_icmpaccess write_priv_set=net_icmpaccess' icmp6 ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^inotify " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' inotify ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^ip " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'ip 0666 root sys' -p 'read_priv_set=net_rawaccess write_priv_set=net_rawaccess' ip ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^ip6 " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'ip6 0666 root sys' -p 'read_priv_set=net_rawaccess write_priv_set=net_rawaccess' ip6 ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^ipnet " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'lo0 0666 root sys' -p 'read_priv_set=net_observability write_priv_set=net_observability' ipnet ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^ippctl " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  ippctl ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^ipsecah " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'ipsecah 0666 root sys' -p 'read_priv_set=sys_ip_config write_priv_set=sys_ip_config' ipsecah ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^ipsecesp " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'ipsecesp 0666 root sys' -p 'read_priv_set=sys_ip_config write_priv_set=sys_ip_config' ipsecesp ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^iptun " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  iptun ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^iwscn " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  iwscn ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^keysock " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'keysock 0666 root sys' -p 'read_priv_set=sys_ip_config write_priv_set=sys_ip_config' keysock ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^kmdb " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  kmdb ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^ksensor " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  ksensor ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^kstat " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' kstat ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^ksyms " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' ksyms ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^lofi " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0600 root sys','ctl 0644 root sys' lofi ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^log " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'conslog 0666 root sys','log 0640 root sys' log ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^logindmux " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  logindmux ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^mm " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'allkmem 0600 root sys','full 0666 root sys','kmem 0640 root sys','mem 0640 root sys','null 0666 root sys','zero 0666 root sys' -p 'allkmem read_priv_set=all write_priv_set=all' mm ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^openeepr " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'openprom 0640 root sys' -p write_priv_set=all openeepr ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^options " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  options ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^physmem " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0600 root sys' physmem ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^poll " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' poll ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^power " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  power ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^ptc " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' ptc ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^pts " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0644 root sys','0 0620 root tty','1 0620 root tty','2 0620 root tty','3 0620 root tty' pts ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^ptsl " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' ptsl ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^ramdisk " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0600 root sys','ctl 0644 root sys' ramdisk ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^random " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0644 root sys' -p write_priv_set=sys_devices random ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^rts " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'rts 0666 root sys' rts ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^sad " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'admin 0666 root sys','user 0666 root sys' sad ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^signalfd " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' signalfd ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^smbios " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'smbios 0444 root sys' smbios ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^softmac " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  softmac ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^spdsock " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'spdsock 0666 root sys' -p 'read_priv_set=sys_ip_config write_priv_set=sys_ip_config' spdsock ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^sy " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'tty 0666 root tty' sy ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^sysevent " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0600 root sys' sysevent ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^sysmsg " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'msglog 0600 root sys','sysmsg 0600 root sys' sysmsg ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^tcp " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'tcp 0666 root sys' tcp ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^tcp6 " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'tcp6 0666 root sys' tcp6 ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^timerfd " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0666 root sys' timerfd ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^tzmon " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  tzmon ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^ucode " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0644 root sys' ucode ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^udp " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'udp 0666 root sys' udp ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^udp6 " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'udp6 0666 root sys' udp6 ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^ufm " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m 'ufm 0666 root sys' ufm ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^vnd " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  vnd ) )
	[ "$ZONEINST" = "1" ] || (grep -c "^wc " $BASEDIR/etc/name_to_major >/dev/null || ( add_drv -n  $BASEDIR_OPT  -m '* 0600 root sys' wc ) )
	
	# [ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/boot/solaris/bin && ln -f -s ../../../usr/sbin/root_archive $BASEDIR/boot/solaris/bin/root_archive)
	# [ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/dev && ln -f -s ../devices/pseudo/dld@0:ctl $BASEDIR/dev/dld)
	# [ "$ZONEINST" = "1" ] || (mkdir -p $BASEDIR/kernel/misc/amd64 && ln -f -s ../../../kernel/crypto/amd64/des $BASEDIR/kernel/misc/amd64/des)
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument '$1'" >&2
        exit 1
    ;;
esac



# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0

